Skip to content

Add FAQ about restricting methods to specific addresses#745

Open
garwalsh wants to merge 4 commits intomainfrom
garwalsh-faq-update
Open

Add FAQ about restricting methods to specific addresses#745
garwalsh wants to merge 4 commits intomainfrom
garwalsh-faq-update

Conversation

@garwalsh
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Nov 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2023 7:16pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
07-oracles ⬜️ Ignored (Inspect) Visit Preview Nov 27, 2023 7:16pm

@garwalsh garwalsh marked this pull request as ready for review November 26, 2023 15:08
@garwalsh garwalsh requested a review from a team as a code owner November 26, 2023 15:08
@@ -157,4 +174,4 @@ Pasta curves (Pallas and Vesta). See [Pasta Curves](https://o1-labs.github.io/pr

### When do I use Provable conditional logic?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### When do I use Provable conditional logic?
### When do I use provable conditional logic?

### When do I use Provable conditional logic?

Are there situations in which I would not want to use the Provable versions? If the conditional logic is not part of your provable code, you do not need to use Provable conditional statements. No newline at end of file
Are there situations in which I would not want to use the Provable versions? If the conditional logic is not part of your provable code, you do not need to use Provable conditional statements.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Are there situations in which I would not want to use the Provable versions? If the conditional logic is not part of your provable code, you do not need to use Provable conditional statements.
Are there situations in which I would not want to use the provable versions? If the conditional logic is not part of your provable code, you do not need to use Provable conditional statements.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@garwalsh we don't need to capitalize Provable (unless it's a proper noun?)

```

- Require a private key as a private input, and check that `privateKey.toPublicKey().assertEquals(this.address)`
- Require a signature as an input.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by Require a signature as an input. do we mean to use the default value of signature? like https://docs.minaprotocol.com/zkapps/o1js/permissions#default-permissions

or do we want to set explicitly set the input field permission to signature? (or something else entirely?)

I was looking for a doc to link to, and found out that I need to learn more about what this means.

Permissions doc https://docs.minaprotocol.com/zkapps/o1js/permissions

signature: Fields that have their permission set to signature can only be manipulated by account updates that are accompanied and authorized by a valid signature.

Or do we mean something as described in https://docs.minaprotocol.com/zkapps/o1js/interact-with-mina#signing-transactions-and-explicit-account-updates ?

Signature authorization – used to update user accounts. Signatures are verified against the account's public key.

@barriebyron
Copy link
Contributor

@garwalsh for questions like this, let's link to a doc for more learning. See my (many) questions, thanks

### How do I restrict a provable method so that it can be invoked only by a specific address?

There are a number of ways to accomplish this:
- Provably add a signed child account update. Then, the method can be invoked only with a signature from the predefined address.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Provably add a signed child account update. Then, the method can be invoked only with a signature from the predefined address.
- Provably add a signed child account update. Then, you can invoke the method only with a signature from the predefined address.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking at open PRs and noticed we let this one get stale... do we want to discuss? @garwalsh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants